<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
  <script src="js/jquery-3.2.1.min.js"></script>
  
  <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
   <div class="layui-card">
   <div class="layui-card-header"><b>题目描述</b></div>
   <div class="layui-card-body">
    ${question.getDescribes() }
   </div>
   </div>
   <div class="layui-card">
   <div class="layui-card-header"><b>程序输入说明</b></div>
   <div class="layui-card-body">
    ${question.getInputexplain() }
   </div>
   </div>
   <div class="layui-card">
   <div class="layui-card-header"><b>程序输出说明</b></div>
   <div class="layui-card-body">
    ${question.getOutputexplain() }
   </div>
   </div>
   <div class="layui-card">
   <div class="layui-card-header"><b>程序输入样例</b></div>
   <div class="layui-card-body">
    ${question.getInputexample() }
   </div>
   </div>
   <div class="layui-card">
   <div class="layui-card-header"><b>程序输出样例</b></div>
   <div class="layui-card-body">
    ${question.getOutputexample() }
   </div>
   </div>
   <div class="layui-card">
   <div class="layui-card-header"><b>提示</b></div>
   <div class="layui-card-body">
    ${question.getTips() }
   </div>
   </div>
   <div><input class="layui-btn"	 type="button" onclick="writecode()" value="提交代码"/></div>

   
   <script type="text/javascript">
   
      function writecode(){
    	  var worktitle = '${worktitle}'
    	  var testid = ${testid };
    	  var workid = ${workid};
    	  var questionid = ${question.getId()};
    	  
    	  
    	  
    	  
    	  var parames = new Array();
          parames.push({ name: "worktitle", value: worktitle});
          parames.push({ name: "testid", value: testid});
          parames.push({ name: "workid", value: workid});
          parames.push({ name: "questionid", value: questionid});
          Post("subcode", parames);

          return false;
      }
      
      
      
      /*
       *功能： 模拟form表单的提交
       *参数： URL 跳转地址 PARAMTERS 参数
       */
       function Post(URL, PARAMTERS) {
           //创建form表单
           var temp_form = document.createElement("form");
           temp_form.action = URL;
           //如需打开新窗口，form的target属性要设置为'_blank'
           temp_form.target = "_self";
           temp_form.method = "post";
           temp_form.style.display = "none";
           //添加参数
           for (var item in PARAMTERS) {
               var opt = document.createElement("textarea");
               opt.name = PARAMTERS[item].name;
               opt.value = PARAMTERS[item].value;
               temp_form.appendChild(opt);
           }
           document.body.appendChild(temp_form);
           //提交数据
           temp_form.submit();
       }
   </script>
   <script src="layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
</body>
</html>